home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gsl.idb / usr / freeware / include / gsl_mode.h.z / gsl_mode.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  1.3 KB  |  55 lines

  1. /* Author:  B. Gough and G. Jungman
  2.  * RCS:     $Id: gsl_mode.h,v 1.1 1998/12/15 17:46:24 jungman Exp $
  3.  */
  4. #ifndef GSL_MODE_H
  5. #define GSL_MODE_H
  6.  
  7.  
  8. /* Some functions can take a mode argument. This
  9.  * is a rough method to do things like control
  10.  * the precision of the algorithm. This mainly
  11.  * occurs in special functions, but we figured
  12.  * it was ok to have a general facility.
  13.  *
  14.  * The mode type is 32-bit field. Most of
  15.  * the fields are currently unused. Users
  16.  * '|' various predefined constants to get
  17.  * a desired mode.
  18.  */
  19. typedef unsigned int gsl_mode_t;
  20.  
  21.  
  22. /* Here are the predefined constants.
  23.  * Note that the precision constants
  24.  * are special because they are used
  25.  * to index arrays, so do not change
  26.  * them. The precision information is
  27.  * in the low order 3 bits of gsl_mode_t
  28.  * (the third bit is currently unused).
  29.  */
  30.  
  31. /* Note that "0" is double precision,
  32.  * so that you get that by default if
  33.  * you forget a flag.
  34.  */
  35. #define GSL_PREC_DOUBLE  0
  36. #define GSL_PREC_SINGLE  1
  37. #define GSL_PREC_APPROX  2
  38.  
  39. #ifdef HAVE_INLINE
  40. inline unsigned int
  41. GSL_MODE_PREC(gsl_mode_t mt)
  42. { return  (mt & (unsigned int)7); }
  43. #else
  44. #define GSL_MODE_PREC(mt) ((mt) & (unsigned int)7)
  45. #endif
  46.  
  47.  
  48.  
  49. /* Here are some predefined generic modes.
  50.  */
  51. #define GSL_MODE_DEFAULT  0
  52.  
  53.  
  54. #endif /* !GSL_MODE_H */
  55.